package com.example.lending.Model.Dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import com.example.lending.Model.Operation;

import java.util.List;
@Dao
public interface OperationDao {

    @Insert
    void insertOperation(Operation... Operations);
    @Update
    void updataOperation(Operation... Operations);

    @Delete
    void deleteOperation(Operation... Operations);

    @Query("delete from operation")
    void deleteAllOperation();

    @Query("select * from operation order by username desc")
    LiveData<List<Operation>> getAllOperationLive();
}
